package com.jwthhealth_pub.old.constitution;

import android.util.Log;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.app.App;


/**
 * Created by Administrator on 2016/12/15.
 */

public class ConstitutionTypeUtil {
    /*
     1,平和质(8) 2，气虚质 3，阳虚质 4，阴虚质 5，痰湿质 6，湿热质 7，血瘀质 8，气郁质 9，特禀质
     */

    /**
     * 获取体制名称
     * @param index
     * @return
     */
    public static String getType(int index){
        String type = null;
        switch (index){
            case 0:
                type = App.mContext.getResources().getString(R.string.constitution_one);
                break;
            case 1:
                type = App.mContext.getResources().getString(R.string.constitution_two);
                break;
            case 2:
                type = App.mContext.getResources().getString(R.string.constitution_thr);
                break;
            case 3:
                type = App.mContext.getResources().getString(R.string.constitution_for);
                break;
            case 4:
                type = App.mContext.getResources().getString(R.string.constitution_fiv);
                break;
            case 5:
                type = App.mContext.getResources().getString(R.string.constitution_six);
                break;
            case 6:
                type = App.mContext.getResources().getString(R.string.constitution_sev);
                break;
            case 7:
                type = App.mContext.getResources().getString(R.string.constitution_eig);
                break;
            case 8:
                type = App.mContext.getResources().getString(R.string.constitution_nin);
                break;
            default:break;
        }
        
        return type;
    }


    public static String getTypeLetter(int index) {
        String letter = "";
        switch (index) {
            case 0:
                letter = "a";
                break;
            case 1:
                letter = "b";
                break;
            case 2:
                letter = "c";
                break;
            case 3:
                letter = "d";
                break;
            case 4:
                letter = "e";
                break;
            case 5:
                letter = "f";
                break;
            case 6:
                letter = "g";
                break;
            case 7:
                letter = "h";
                break;
            case 8:
                letter = "i";
                break;
            default:break;
        }
        return letter;
    }

    /**
     * a	平和质
     b	气虚质
     c	阳虚质
     d	阴虚质
     e	痰湿质
     f  湿热质
     g	血瘀质
     h	气郁质
     i	特禀质
     * @param index
     */
    public static String getTypeName(String index) {
        String name = "";
        switch (index) {
            case "a": name = "平和质";break;
            case "b": name = "气虚质";break;
            case "c": name = "阳虚质";break;
            case "d": name = "阴虚质";break;
            case "e": name = "痰湿质";break;
            case "f": name = "湿热质";break;
            case "g": name = "血瘀质";break;
            case "h": name = "气郁质";break;
            case "i": name = "特禀质";break;
            default:break;
        }

        return name;
    }

    public static int getConstitutionIndex(String letter) {
        switch (letter) {
            case "a":return 0;
            case "b":return 1;
            case "c":return 2;
            case "d":return 3;
            case "e":return 4;
            case "f":return 5;
            case "g":return 6;
            case "h":return 7;
            case "i":return 8;
            default: return 0;
        }
    }

    /**
     * 小标题
     * @param index
     * @return
     */
    public static String getAnswerTitle(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_summary_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_summary_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_summary_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_summary_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_summary_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_summary_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_summary_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_summary_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 小标题描述
     * @param index
     * @return
     */
    public static String getAnswerSummary(int type, int index){
        String summary = null;
        Log.d("ConstitutionTypeUtil", "type:" + type + " index:"+index);
        switch (type) {
            case 0:
                summary = CharacPinghezhi(index);
                break;
            case 1:
                summary = CharacQixuhzi(index);
                break;
            case 2:
                summary = CharacYangxuzhi(index);
                break;
            case 3:
                summary = CharacYinxuzhi(index);
                break;
            case 4:
                summary = CharacTanshizhi(index);
                break;
            case 5:
                summary = CharacShirezhi(index);
                break;
            case 6:
                summary = CharacXueyvzhi(index);
                break;
            case 7:
                summary = CharacQiyvzhi(index);
                break;
            case 8:
                summary = CharacTebingzhi(index);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 平和质特征
     * @param index
     * @return
     */
    public static String CharacPinghezhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_pinghezhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 气虚质特征
     * @param index
     * @return
     */
    public static String CharacQixuhzi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_qisuzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 阳虚质特征
     * @param index
     * @return
     */
    public static String CharacYangxuzhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_yangxuzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 阴虚质特征
     * @param index
     * @return
     */
    public static String CharacYinxuzhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_yinxuzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 痰湿质特征
     * @param index
     * @return
     */
    public static String CharacTanshizhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_tanshizhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 湿热质特征
     * @param index
     * @return
     */
    public static String CharacShirezhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_shirezhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 血瘀质特征
     * @param index
     * @return
     */
    public static String CharacXueyvzhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_xueyvzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 气郁质特征
     * @param index
     * @return
     */
    public static String CharacQiyvzhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_qiyvzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    /**
     * 特禀质特征
     * @param index
     * @return
     */
    public static String CharacTebingzhi(int index){
        String summary = null;
        switch (index) {
            case 1:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_zong);
                break;
            case 2:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_xing);
                break;
            case 3:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_biao);
                break;
            case 4:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_xin);
                break;
            case 5:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_bing);
                break;
            case 6:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_shi);
                break;
            case 7:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_bian);
                break;
            case 8:
                summary = App.mContext.getResources().getString(R.string.answer_tebingzhi_tiao);
                break;
            default:break;
        }
        return summary;
    }

    public static String GetDietTitle(String topid, String id) {
        String title = "";

        if (topid.equals("1")){
           title = getTypeName(id) + " 饮食调养";
        } else if (topid.equals("2")) {
            title = GetNursedTitle(id) + " 饮食调养";
        } else if (topid.equals("3")){
            title = getSensonTitle(id);
        }

        return title;
    }

    public static String GetNursedTitle(String id) {
        String title = "";

        switch (id) {
            case "1":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_one);
                break;
            case "2":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_two);
                break;
            case "3":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_thi);
                break;
            case "4":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_for);
                break;
            case "5":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_fiv);
                break;
            case "6":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_six);
                break;
            case "7":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_sev);
                break;
            case "8":
                title = App.mContext.getResources().getString(R.string.diet_nursed_title_eig);
                break;
            default:break;
        }

        return title;
    }

    public static String getSensonTitle(String ip){
        String title = "";
        switch (ip) {
            case "1":
                title = App.mContext.getResources().getString(R.string.diet_season_one) + "季饮食调养";
                break;
            case "2":
                title = App.mContext.getResources().getString(R.string.diet_season_two) + "季饮食调养";
                break;
            case "3":
                title = App.mContext.getResources().getString(R.string.diet_season_thi) + "季饮食调养";
                break;
            case "4":
                title = App.mContext.getResources().getString(R.string.diet_season_for) + "季饮食调养";
                break;
            default:break;
        }

        return title;
    }

}
